import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class MapMain {
	
	public static void main(String[] args){
		Map<String, Integer> map = new HashMap<String,Integer>();
		map.put("Lucy",5);
		map.put("Lily", 4);
		map.put("Han Meimei", 5);
		map.put("Jim", 3);
		map.put("Zou Encen", 3);
		map.put("Shichiyu", 0);
		//题目一
		System.out.println("use key: Shichiyu find value:"+map.get("Shichiyu"));
		System.out.println("use key: Zou Encen find value:"+map.get("Zou Encen"));
		System.out.println("use key: Tom find value:"+map.get("Tom"));
		//题目二
		Iterator it = map.entrySet().iterator();
		Map.Entry entry = null;
		while(it.hasNext()){
			entry = (Map.Entry) it.next();
			System.out.println("Use iteratir to get the key is" +entry.getKey()+"\tvalue is"+entry.getValue());
		}
	}
	
}
